home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / tcl / configure < prev    next >
Text File  |  1993-05-05  |  12KB  |  468 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      *) ;;
  74.     esac
  75.   fi
  76. done
  77.  
  78. trap 'rm -f conftest* core; exit 1' 1 3 15
  79.  
  80. rm -f conftest*
  81. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  82.  
  83. # A filename unique to this package, relative to the directory that
  84. # configure is in, which we can look for to find out if srcdir is correct.
  85. unique_file=tcl.h
  86.  
  87. # Find the source files, if location was not specified.
  88. if test -z "$srcdir"; then
  89.   srcdirdefaulted=yes
  90.   # Try the directory containing this script, then `..'.
  91.   prog=$0
  92.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  93.   test "X$confdir" = "X$prog" && confdir=.
  94.   srcdir=$confdir
  95.   if test ! -r $srcdir/$unique_file; then
  96.     srcdir=..
  97.   fi
  98. fi
  99. if test ! -r $srcdir/$unique_file; then
  100.   if test x$srcdirdefaulted = xyes; then
  101.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  102.   else
  103.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  104.   fi
  105.   exit 1
  106. fi
  107. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  108. # But we can't avoid them for `..', to make subdirectories work.
  109. case $srcdir in
  110.   .|/*|~*) ;;
  111.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  112. esac
  113.  
  114. # Make sure to not get the incompatible SysV /etc/install and
  115. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  116. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  117. # or the AFS install, which mishandles nonexistent args.  (Sigh.)
  118. if test -z "$INSTALL"; then
  119.   echo checking for install
  120.   saveifs="$IFS"; IFS="${IFS}:"
  121.   for dir in $PATH; do
  122.     test -z "$dir" && dir=.
  123.     case $dir in
  124.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
  125.     *)
  126.       if test -f $dir/install; then
  127.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  128.       : # AIX
  129.     else
  130.       INSTALL="$dir/install -c"
  131.       INSTALL_PROGRAM='$(INSTALL)'
  132.       INSTALL_DATA='$(INSTALL) -m 644'
  133.       break
  134.     fi
  135.       fi
  136.       ;;
  137.     esac
  138.   done
  139.   IFS="$saveifs"
  140. fi
  141. INSTALL=${INSTALL-cp}
  142. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  143. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  144.  
  145. if test -z "$RANLIB"; then
  146.   echo checking for ranlib
  147.   saveifs="$IFS"; IFS="${IFS}:"
  148.   for dir in $PATH; do
  149.     test -z "$dir" && dir=.
  150.     if test -f $dir/ranlib; then
  151.       RANLIB="ranlib"
  152.       break
  153.     fi
  154.   done
  155.   IFS="$saveifs"
  156. fi
  157. test -z "$RANLIB" && RANLIB="@:"
  158.  
  159. echo checking for pid_t in sys/types.h
  160. echo checking how to run the C preprocessor
  161. if test -z "$CPP"; then
  162.   CPP='${CC-cc} -E'
  163.   cat > conftest.c <<EOF
  164. #include <stdio.h>
  165. EOF
  166. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  167. if test -z "$err"; then
  168.   :
  169. else
  170.   CPP=/lib/cpp
  171. fi
  172. rm -f conftest*
  173. fi
  174.  
  175. echo '#include <sys/types.h>' > conftest.c
  176. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  177. if egrep "pid_t" conftest.out >/dev/null 2>&1; then
  178.   DEFS="$DEFS -DTCL_PID_T=1"
  179. else 
  180.   DEFS="$DEFS -DTCL_PID_T=0"
  181. fi
  182. rm -f conftest*
  183.  
  184. echo checking for ANSI C header files
  185. cat > conftest.c <<EOF
  186. #include <stdlib.h>
  187. #include <stdarg.h>
  188. #include <string.h>
  189. #include <float.h>
  190. EOF
  191. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  192. if test -z "$err"; then
  193.   # SunOS string.h does not declare mem*, contrary to ANSI.
  194. echo '#include <string.h>' > conftest.c
  195. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  196. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  197.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  198. cat > conftest.c <<EOF
  199. #include <ctype.h>
  200. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  201. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  202. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  203. int main () { int i; for (i = 0; i < 256; i++)
  204. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  205. exit (0); }
  206.  
  207. EOF
  208. eval $compile
  209. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  210.   DEFS="$DEFS -DSTDC_HEADERS=1"
  211. fi
  212. rm -f conftest*
  213. fi
  214. rm -f conftest*
  215.  
  216. fi
  217. rm -f conftest*
  218.  
  219. echo checking for unistd.h
  220. cat > conftest.c <<EOF
  221. #include <unistd.h>
  222. EOF
  223. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  224. if test -z "$err"; then
  225.   DEFS="$DEFS -DHAVE_UNISTD_H=1"
  226. fi
  227. rm -f conftest*
  228.  
  229. echo checking for dirent.h
  230. cat > conftest.c <<EOF
  231. #include <dirent.h>
  232. EOF
  233. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  234. if test -z "$err"; then
  235.   DEFS="$DEFS -DHAVE_DIRENT=1"
  236. fi
  237. rm -f conftest*
  238.  
  239.  
  240.  
  241. for func in opendir strerror strstr strtod strtol
  242. do
  243. echo checking for ${func}
  244. cat > conftest.c <<EOF
  245.  
  246. main() { exit(0); } 
  247. t() { 
  248. /* Override any gcc2 internal prototype to avoid an error.  */
  249. extern char ${func}(); ${func}(); }
  250. EOF
  251. if eval $compile; then
  252.   :
  253. else
  254.   LIBOBJS="$LIBOBJS ${func}.o"
  255. fi
  256. rm -f conftest*
  257.  
  258. done
  259.  
  260. echo checking for getwd
  261. cat > conftest.c <<EOF
  262. #include <stdio.h>
  263. main() { exit(0); } 
  264. t() { 
  265. #ifdef __stub_getwd
  266. choke me
  267. #else
  268. /* Override any gcc2 internal prototype to avoid an error.  */
  269. extern char getwd(); getwd();
  270. #endif
  271.  }
  272. EOF
  273. if eval $compile; then
  274.   DEFS="$DEFS -DTCL_GETWD=1"
  275. else
  276.   DEFS="$DEFS -DTCL_GETWD=0"
  277. fi
  278. rm -f conftest*
  279. #endif
  280.  
  281. echo checking for gettimeofday
  282. cat > conftest.c <<EOF
  283. #include <stdio.h>
  284. main() { exit(0); } 
  285. t() { 
  286. #ifdef __stub_gettimeofday
  287. choke me
  288. #else
  289. /* Override any gcc2 internal prototype to avoid an error.  */
  290. extern char gettimeofday(); gettimeofday();
  291. #endif
  292.  }
  293. EOF
  294. if eval $compile; then
  295.   DEFS="$DEFS -DTCL_GETTOD=1"
  296. else
  297.   DEFS="$DEFS -DTCL_GETTOD=0"
  298. fi
  299. rm -f conftest*
  300. #endif
  301.  
  302.  
  303. cat > conftest.c <<EOF
  304.  /* this program taken from compat/teststrtoul.c */
  305. extern int strtoul();
  306. int main()
  307. {
  308.     char *string = "0";
  309.     char *term;
  310.     int value;
  311.     value = strtoul(string, &term, 0);
  312.     if ((value != 0) || (term != (string+1))) {
  313.         exit(1);
  314.     }
  315.     exit(0);
  316. }
  317. EOF
  318. eval $compile
  319. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  320.   :
  321. else
  322.   LIBOBJS="$LIBOBJS strtoul.o"
  323. fi
  324. rm -f conftest*
  325.  
  326. echo checking for union wait
  327. cat > conftest.c <<EOF
  328. #include <sys/types.h> 
  329. #include <sys/wait.h>
  330. main() { exit(0); } 
  331. t() {  /* this program taken from compat/testwait.c */
  332. /* This code is very tricky, mostly because of weirdness in HP-UX
  333.  * where "union wait" is defined in both the BSD and SYS-V
  334.  * environments.  Supposedly the WIFEXITED business will do the
  335.  * right thing... */
  336. union wait x;
  337. WIFEXITED(x);               /* Generates compiler error if WIFEXITED
  338.                                  * uses an int. */
  339. return 0;
  340.  }
  341. EOF
  342. if eval $compile; then
  343.   DEFS="$DEFS -DTCL_UNION_WAIT=1"
  344. else
  345.   DEFS="$DEFS -DTCL_UNION_WAIT=0"
  346. fi
  347. rm -f conftest*
  348.  
  349.  
  350. echo checking for unsigned characters
  351. cat > conftest.c <<EOF
  352. /* volatile prevents gcc2 from optimizing the test away on sparcs.  */
  353. #if !__STDC__
  354. #define volatile
  355. #endif
  356. main() {
  357. #ifdef __CHAR_UNSIGNED__
  358.   exit(1); /* No need to redefine it.  */
  359. #else
  360.   volatile char c = 255; exit(c < 0);
  361. #endif
  362. }
  363. EOF
  364. eval $compile
  365. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  366.   DEFS="$DEFS -D__CHAR_UNSIGNED__=1"
  367. fi
  368. rm -f conftest*
  369.  
  370. prog='/* Ultrix mips cc rejects this.  */
  371. typedef int charset[2]; const charset x;
  372. /* SunOS 4.1.1 cc rejects this. */
  373. char const *const *p;
  374. char **p2;
  375. /* HPUX 7.0 cc rejects these. */
  376. ++p;
  377. p2 = (char const* const*) p;'
  378. echo checking for working const
  379. cat > conftest.c <<EOF
  380.  
  381. main() { exit(0); } 
  382. t() { $prog }
  383. EOF
  384. if eval $compile; then
  385.   :
  386. else
  387.   DEFS="$DEFS -Dconst="
  388. fi
  389. rm -f conftest*
  390.  
  391. if test -n "$prefix"; then
  392.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  393.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  394. fi
  395. if test -n "$exec_prefix"; then
  396.   prsub="$prsub
  397. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  398. exec_prefix\\1=\\2$exec_prefix%"
  399. fi
  400.  
  401. trap 'rm -f config.status; exit 1' 1 3 15
  402. echo creating config.status
  403. rm -f config.status
  404. cat > config.status <<EOF
  405. #!/bin/sh
  406. # Generated automatically by configure.
  407. # Run this file to recreate the current configuration.
  408. # This directory was configured as follows,
  409. # on host `(hostname || uname -n) 2>/dev/null`:
  410. #
  411. # $0 $*
  412.  
  413. for arg
  414. do
  415.   case "\$arg" in
  416.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  417.   exec /bin/sh $0 $* ;;
  418.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  419. esac
  420. done
  421.  
  422. trap 'rm -f Makefile; exit 1' 1 3 15
  423. INSTALL='$INSTALL'
  424. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  425. INSTALL_DATA='$INSTALL_DATA'
  426. RANLIB='$RANLIB'
  427. CPP='$CPP'
  428. LIBOBJS='$LIBOBJS'
  429. LIBS='$LIBS'
  430. srcdir='$srcdir'
  431. DEFS='$DEFS'
  432. prefix='$prefix'
  433. exec_prefix='$exec_prefix'
  434. prsub='$prsub'
  435. EOF
  436. cat >> config.status <<\EOF
  437.  
  438. top_srcdir=$srcdir
  439. for file in .. Makefile; do if [ "x$file" != "x.." ]; then
  440.   srcdir=$top_srcdir
  441.   # Remove last slash and all that follows it.  Not all systems have dirname.
  442.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  443.   if test "$dir" != "$file"; then
  444.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  445.     test ! -d $dir && mkdir $dir
  446.   fi
  447.   echo creating $file
  448.   rm -f $file
  449.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  450.   sed -e "
  451. $prsub
  452. s%@INSTALL@%$INSTALL%g
  453. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  454. s%@INSTALL_DATA@%$INSTALL_DATA%g
  455. s%@RANLIB@%$RANLIB%g
  456. s%@CPP@%$CPP%g
  457. s%@LIBOBJS@%$LIBOBJS%g
  458. s%@LIBS@%$LIBS%g
  459. s%@srcdir@%$srcdir%g
  460. s%@DEFS@%$DEFS%
  461. " $top_srcdir/${file}.in >> $file
  462. fi; done
  463.  
  464. EOF
  465. chmod +x config.status
  466. test -n "$no_create" || ./config.status
  467.  
  468.